/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 *
 * @author: jin Chen 
 * @date: Nov 18, 2005$
 * @version: 1.0
 */
package edu.psu.geovista.app.gmatrix.toolkit;

import edu.psu.geovista.app.gmatrix.canvas.Cell;
import edu.psu.geovista.app.gmatrix.canvas.DfCell;
import edu.psu.geovista.app.gmatrix.canvas.Symbol;

import java.util.HashMap;
import java.util.Map;

public class CellFactory {
    Map cells=new HashMap(4);
    public  Cell createCell(Symbol  symbol){
        Class<? extends Symbol> symbolclass = symbol.getClass();
        Cell cell = (Cell) cells.get(symbolclass );
        if(cell==null){
            cell=new DfCell(symbol);
            cells.put(symbolclass, cell);
        }
        return cell;

    }
}
